package com.yx.system.dao;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.yx.system.entity.SysUser;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/** 系统用户 Mapper 接口
 * Created by wuye on 2017/11/24.
 */
@Mapper
@Repository
public interface SysUserDao extends BaseMapper<SysUser> {

    List<SysUser> queryPageList(Page<SysUser> page, Map<String, Object> map);

    List<SysUser> queryList(Map<String, Object> map);

    /**
     * 查询用户的所有权限
     * @param userId  用户ID
     */
    List<String> queryAllPerms(Long userId);

    /**
     * 查询用户的所有菜单ID
     */
    List<Long> queryAllMenuId(Long userId);

    /**
     * 根据用户名，查询系统用户
     */
    SysUser queryByUserName(String username);

    int deleteBatch(Object[] id);

    void updateSysUser(SysUser sysUser);

    SysUser findCommonAuthorByUsername(String username);
}
